package com.qianke.common;

import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

public class RedisUtils {

    private RedisUtils() {
    }

    ;

    public static RedisTemplate<String, String> setConnectionFactoryDB(RedisTemplate<String, String> redisTemplate, int index) {
        JedisConnectionFactory connectionFactory = (JedisConnectionFactory) redisTemplate.getConnectionFactory();
        connectionFactory.setDatabase(index);
        return redisTemplate;
    }

}
